home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume15 / nroffgraphics / part02 < prev    next >
Encoding:
Internet Message Format  |  1988-06-06  |  24.4 KB

  1. Subject:  v15i047:  Tools for nroff graphics on dot-matrix printers, Part02/02
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: snark!eric (Eric Raymond)
  7. Posting-number: Volume 15, Issue 47
  8. Archive-name: nroffgraphics/part02
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then unpack
  12. # it by saving it into a file and typing "sh file".  To overwrite existing
  13. # files, type "sh file -c".  You can also feed this as standard input via
  14. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  15. # will see the following message at the end:
  16. #        "End of archive 2 (of 2)."
  17. # Contents:  dotmatrix.c mx80.pix
  18. # Wrapped by rsalz@fig.bbn.com on Tue Jun  7 14:26:53 1988
  19. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  20. if test -f 'dotmatrix.c' -a "${1}" != "-c" ; then 
  21.   echo shar: Will not clobber existing file \"'dotmatrix.c'\"
  22. else
  23. echo shar: Extracting \"'dotmatrix.c'\" \(14559 characters\)
  24. sed "s/^X//" >'dotmatrix.c' <<'END_OF_FILE'
  25. X/*
  26. X * dotmatrix.c -- make driver & postprocessor tables for dot-matrix printers
  27. X *
  28. X * This code brought to you as a public service by Eric S. Raymond, Feb 1988
  29. X * and is copyrighted (c)1988 by the author. Use, distribute, and mangle
  30. X * freely, but don't try to make money selling it unless you're going to send
  31. X * me a cut. Send bug reports, love letters and death threats to eric@snark
  32. X * aka ...!rutgers!vu-vlsi!snark!eric.
  33. X */
  34. X/*LINTLIBRARY*/        /* this suppresses some bogus messages about _iob */
  35. X#include <stdio.h>
  36. X#include <ctype.h>
  37. X
  38. Xextern char *strcpy(), *strchr();
  39. X
  40. X#define TRUE    1
  41. X#define FALSE    0
  42. X
  43. X/*
  44. X * General equates.  Note that this code has insidious ASCII dependencies all
  45. X * through it (in particular, it counts on being able to step through all the
  46. X * normal printables by starting at <sp>). EBCDIC sites can eat flaming death
  47. X * for all I care. Have a nice day.
  48. X */
  49. X#define MAXGLEN    64    /* maximum width of a graphic in bits */
  50. X#define CDEPTH    24    /* MX80 graphics are 8 bits deep */
  51. X#define NAMSIZE    10    /* maximum size of character names */
  52. X#define STAR    '*'    /* bit-on character for picture files */
  53. X#define SI    0x17    /* ASCII SI starts a graphics escape */
  54. X#define SO    0x16    /* ASCII SO ends a graphics escape */
  55. X#define FNS    15    /* maximum size of a local filename + 1 */
  56. X#define MAXLINE    80    /* maximum size of an input line */
  57. X#define MAXMODE    10    /* maximum number of print modes supported */
  58. X
  59. Xtypedef struct
  60. X{
  61. X    char name[NAMSIZE];    /* the mode name */
  62. X    int width;        /* dot-matrix elements per character width */
  63. X    int height;        /* height of chars in this mode */
  64. X    char fmt[NAMSIZE];    /* format string for graphics emission */
  65. X}
  66. Xmode_t;
  67. X
  68. Xstatic mode_t    modes[MAXMODE];            /* printer mode table */
  69. Xstatic mode_t    *maxmode = &modes[0];        /* next free mode slot */
  70. X
  71. Xstatic char    dtabfile[FNS]  = "tab.mx80";    /* driver table source */
  72. Xstatic FILE    *dtabfp;            /* dtabfile open for output */
  73. X
  74. Xstatic char    postproto[FNS] = "post.proto";    /* postprocessor template */
  75. Xstatic FILE    *protofp;            /* postproto open for input */
  76. X
  77. Xstatic char    postcode[FNS]  = "mx80.c";    /* result postprocessor */
  78. Xstatic FILE    *postfp;            /* postcode open for output */
  79. X
  80. Xstatic char    testfile[FNS]  = "mx80.test";    /* result test file */
  81. Xstatic FILE    *testfp;            /* testfile open for output */
  82. X
  83. X/* miscellaneous globals */
  84. Xstatic char    line[MAXLINE];        /* buffer for line processing */
  85. Xstatic char    comment[MAXLINE];   /* description of the type */
  86. Xstatic char    *ptype = "mx80";    /* device type we're customizing for */
  87. Xstatic int    trigger = ' ';        /* trigger character for postprocessor */
  88. Xstatic int    verbose = FALSE;    /* debugging flag */
  89. Xstatic int    quiet = FALSE;        /* if true, suppress stdout msgs */
  90. Xstatic int    testflag = TRUE;    /* test file creation flag */
  91. Xstatic int    postflag = TRUE;    /* postprocessor creation flag */
  92. Xstatic int    dtabflag = TRUE;    /* driver table creation flag */
  93. Xstatic int    forcepost = FALSE;  /* set true to suppress optimization */
  94. Xstatic int    errline = 0;        /* count of input lines processed */
  95. X
  96. Xmain(argc, argv)
  97. Xint    argc;
  98. Xchar    *argv[];
  99. X{
  100. X    void    transpix(), exit();
  101. X    int        c;
  102. X    extern int    optind;
  103. X
  104. X    while ((c = getopt(argc, argv, "nvtpdq")) != EOF)
  105. X    {
  106. X    switch(c)
  107. X    {
  108. X    case 'n':    /* don't try to emit printer controls from the table */
  109. X        forcepost = TRUE;
  110. X        break;
  111. X
  112. X    case 'v':    /* be verbose when parsing the picture file */
  113. X        verbose = TRUE;
  114. X        break;
  115. X
  116. X    case 'q':    /* suppress normal messages to stdout */
  117. X        quiet = TRUE;
  118. X        break;
  119. X
  120. X    case 't':    /* suppress test file creation */
  121. X        testflag = FALSE;
  122. X        break;
  123. X
  124. X    case 'p':    /* suppress postprocessor file creation */
  125. X        postflag = FALSE;
  126. X        break;
  127. X
  128. X    case 'd':    /* suppress driver table creation */
  129. X        dtabflag = FALSE;
  130. X        break;
  131. X    }
  132. X    }
  133. X
  134. X    /* if the user gave a name, rename all files */
  135. X    if (optind < argc)
  136. X    {
  137. X    ptype = argv[optind];
  138. X    (void) sprintf(dtabfile, "tab%s.c", ptype);
  139. X    (void) sprintf(postcode, "%s.c", ptype);
  140. X    (void) sprintf(testfile, "%s.test", ptype);
  141. X    }
  142. X
  143. X    /* open the postprocessor prototype if we're to create one */
  144. X    if (postflag && (protofp = fopen(postproto, "r")) == NULL)
  145. X    {
  146. X    (void) fprintf(stderr, "dotmatrix: can't open %s file!\n", postproto);
  147. X    exit(2);
  148. X    }
  149. X
  150. X    /* open the postprocessor output if we're to generate one */
  151. X    if (postflag && (postfp = fopen(postcode, "w")) == NULL)
  152. X    {
  153. X    (void) fprintf(stderr, "dotmatrix: can't open %s file!\n", postcode);
  154. X    exit(2);
  155. X    }
  156. X
  157. X    /* open the postprocessor output if we're to generate one */
  158. X    if (postflag && (postfp = fopen(postcode, "w")) == NULL)
  159. X    {
  160. X    (void) fprintf(stderr, "dotmatrix: can't open %s file!\n", postcode);
  161. X    exit(2);
  162. X    }
  163. X
  164. X    /* open the driver file output if we're to create one */
  165. X    if (dtabflag && (dtabfp = fopen(dtabfile, "w")) == NULL)
  166. X    {
  167. X    (void) fprintf(stderr, "dotmatrix: can't open %s file!\n", dtabfile);
  168. X    exit(2);
  169. X    }
  170. X
  171. X    /* open the test file output if we're to create one */
  172. X    if (testflag && (testfp = fopen(testfile, "w")) == NULL)
  173. X    {
  174. X    (void) fprintf(stderr, "dotmatrix: can't open %s file!\n", testfile);
  175. X    exit(2);
  176. X    }
  177. X    else if (testflag)
  178. X    (void) fprintf(testfp,
  179. X               ".\\\" %s -- special character test file\n", testfile);
  180. X
  181. X    /* here's where we parse the picture file */
  182. X    if (postflag || dtabflag || testflag)
  183. X    {
  184. X    if (postflag)
  185. X        (void) fprintf(postfp,
  186. X        "/* %s -- postprocessor for %s */\n",
  187. X        postcode, dtabfile);
  188. X
  189. X    while (fgets(line, sizeof(line), protofp) != NULL)
  190. X        if (strncmp(line, "$A", 2) == 0)
  191. X        {
  192. X        transpix();
  193. X        if (postflag)
  194. X            (void) fprintf(postfp, "#define MAXSPCH\t0%03o\n",trigger);
  195. X        }
  196. X        else
  197. X        (void) fputs(line, postfp);
  198. X
  199. X    if (postflag)
  200. X        (void) fprintf(postfp, "/* %s ends here */\n", postcode);
  201. X    }
  202. X
  203. X    /* if we are generating a test file, add a completeness indication */
  204. X    if (testflag)
  205. X    {
  206. X    (void) fprintf(testfp,".\\\" %s ends here\n", testfile);
  207. X    (void) fclose(testfp);
  208. X    }
  209. X    return(0);
  210. X}
  211. X
  212. Xstatic void transpix()
  213. X/* read and translate a picture file from stdin */
  214. X{
  215. X    void    readpic(), enter(), makemode(), makeover();
  216. X    char    tgon[MAXGLEN], tgoff[MAXGLEN], *sp;
  217. X    char    name[NAMSIZE];
  218. X    int        pass = 1;
  219. X
  220. X    for (;;)
  221. X    {
  222. X    /* read in a line to parse */
  223. X    if (gets(line) == NULL)
  224. X        return;
  225. X    else
  226. X        errline++;
  227. X
  228. X    if (verbose)
  229. X        (void) fprintf(stdout, "%s\n", line);
  230. X
  231. X    comment[0] = 0;
  232. X
  233. X    /* copy out the comment if there is one */
  234. X    if ((sp = strchr(line, '#')) != NULL)
  235. X    {
  236. X        (void) strcpy(comment, sp + 1);
  237. X        while (isspace(*sp) || *sp == '#')
  238. X        sp--;
  239. X        *++sp = 0;
  240. X    }
  241. X
  242. X    /* here's where we check for the end of the passthrough section */
  243. X    if (pass)
  244. X    {
  245. X        if (strcmp(line, "charset") == 0)
  246. X        pass = 0;
  247. X        (void) fprintf(dtabfp, "%s\n", line);
  248. X        continue;
  249. X    }
  250. X
  251. X    /* after charset, if the line is blank ignore it */
  252. X    else if (strspn(line, "\t ") == strlen(line))
  253. X        continue;
  254. X
  255. X    /* interpret 'comment' directives */
  256. X    if (strncmp("comment ", line, 8) == 0)
  257. X    {
  258. X        if (postflag)
  259. X        (void) fprintf(postfp, "/* %s */\n", line + 8);
  260. X        continue;
  261. X    }
  262. X
  263. X    /* interpret 'mode' directives */
  264. X    if (strncmp("mode ", line, 5) == 0)
  265. X    {
  266. X        makemode(line);
  267. X        continue;
  268. X    }
  269. X
  270. X    /* interpret 'toggle' directives */
  271. X    if (sscanf(line, "toggle %s \"%[^\"]\" \"%[^\"]\"", name, tgon, tgoff))
  272. X    {
  273. X        /* interpret escape sequences including \000 */
  274. X        int tgonl = escape(tgon, tgon);
  275. X        int tgoffl = escape(tgoff, tgoff);
  276. X        
  277. X        /*   Name    Width    Tstate    Size    Data */
  278. X        enter(name,    0,    0,    tgonl,    tgon);
  279. X        enter(name, 0,    1,    tgoffl,    tgoff);
  280. X
  281. X        /* now we may need to generate a test file line */
  282. X        if (testflag)
  283. X        (void) fprintf(testfp,
  284. X            "This is a test of the %s\\%s%s toggle\n.br\n",
  285. X            name, name, name);
  286. X
  287. X        continue;
  288. X    }
  289. X
  290. X    /* interpret 'picture' sections */
  291. X    if (strncmp("picture ", line, 8) == 0)
  292. X    {
  293. X        readpic();
  294. X        continue;
  295. X    }
  296. X
  297. X    /* interpret 'test' directives */
  298. X    if (strncmp("test ", line, 5) == 0 && testflag)
  299. X    {
  300. X        (void) fprintf(testfp, "%s\n.br\n", line + 5);
  301. X        continue;
  302. X    }
  303. X
  304. X    /* interpret 'overstrike ' directives */
  305. X    if (strncmp("overstrike ", line, 11) == 0)
  306. X    {
  307. X        makeover(line);
  308. X        continue;
  309. X    }
  310. X
  311. X    /* else there's garbage on the line */
  312. X    (void) fprintf(stderr,
  313. X               "dotmatrix: unknown command, line %d\n", errline);
  314. X    exit(1);
  315. X    }
  316. X}
  317. X
  318. Xstatic void makemode(mline)
  319. X/* process a printer mode declaration */
  320. Xchar *mline;
  321. X{
  322. X    if (maxmode >= modes + MAXMODE - 1)
  323. X    {
  324. X    (void) fprintf(stderr, "dotmatrix: too many print modes\n");
  325. X    exit(1);
  326. X    }
  327. X
  328. X    if (sscanf(mline, "mode %s %d %d \"%[^\"]\"",
  329. X        maxmode->name, &maxmode->width, &maxmode->height, maxmode->fmt)
  330. X        != 4)
  331. X    (void) fprintf(stderr, "dotmatrix: invalid mode line ignored\n");
  332. X    else if (maxmode->height > CDEPTH)
  333. X    (void) fprintf(stderr, "dotmatrix: height must be < %d\n", CDEPTH);
  334. X    else
  335. X    {
  336. X    (void) escape(maxmode->fmt, maxmode->fmt);
  337. X    maxmode++;
  338. X    }
  339. X}
  340. X
  341. Xstatic void makeover(oline)
  342. X/* interpret an overstrike directive */
  343. Xchar *oline;
  344. X{
  345. X    char    name[NAMSIZE], value[MAXGLEN];
  346. X    int fc;
  347. X
  348. X    if ((fc = sscanf(oline, "overstrike %s %s", name, value)) != 2)
  349. X    {
  350. X    (void) fprintf(stderr,
  351. X        "dotmatrix: overstrike directive invalid, %d arguments found\n",
  352. X        fc);
  353. X    exit(1);
  354. X    }
  355. X    else
  356. X    {
  357. X    (void) escape(value, value);
  358. X    enter(name, 0, 2, 1, value);
  359. X
  360. X    /* now we may need to generate a test file line */
  361. X    if (testflag)
  362. X        (void) fprintf(testfp,
  363. X               "%sThis is a test%s of the \\%s overstrike\n.br\n",
  364. X               name, name, name);
  365. X    }
  366. X}
  367. X
  368. Xstatic void readpic()
  369. X/* process a single picture file entry */
  370. X{
  371. X    char    name[NAMSIZE];        /* nroff name of the graphic */
  372. X    int        width = 1;            /* the graphic width */
  373. X    char    type[NAMSIZE];        /* type of the graphic (optional) */
  374. X    char    value[MAXGLEN + NAMSIZE];    /* what we'll send */
  375. X    char    graphic[MAXGLEN][CDEPTH];   /* where we'll read in the pattern */
  376. X    int        lrow[CDEPTH];        /* the row lengths */
  377. X    int        row, i, cwidth;        /* scratch variables */
  378. X    char    *sp, *tp;            /* scratch variables */
  379. X    mode_t  *mode;            /* print mode selector */
  380. X
  381. X    /* scan the header line */
  382. X    if (sscanf(line, "picture %s %d %s", name, &width, type) != 3)
  383. X    {
  384. X    (void) fprintf(stderr,
  385. X               "dotmatrix: invalid picture directive: %s\n", line);
  386. X    exit(1);
  387. X    }
  388. X
  389. X    /* identify the print mode */
  390. X    for (mode = modes; mode <= maxmode; mode++)
  391. X    if (strcmp(type, mode->name) == 0)
  392. X        break;
  393. X    if (mode == maxmode)
  394. X    {
  395. X    (void) fprintf(stderr,
  396. X        "dotmatrix: %s is not a declared print mode, picture ignored\n",
  397. X        type);
  398. X    return;
  399. X    }
  400. X
  401. X    /* next read in the pattern bits */
  402. X    for (row = 0; row < mode->height; row++)
  403. X    {
  404. X    if (fgets(graphic[row], MAXGLEN, stdin) == NULL)
  405. X    {
  406. X        (void) fprintf(stderr,
  407. X        "dotmatrix: ran out of graphic lines in %s\n",
  408. X        name);
  409. X        exit(1);
  410. X    }
  411. X    else if (verbose)
  412. X        (void) fprintf(stderr, "row %d: %s", row, graphic[row]);
  413. X    }
  414. X
  415. X    /* emit the pattern strings if we're generating a postprocessor */
  416. X    if (postflag)
  417. X    {
  418. X    /* now interpret special escape */
  419. X    tp = value;
  420. X    cwidth = 0;
  421. X    for (sp = mode->fmt; *sp; sp++)
  422. X    {
  423. X        if (*sp != '%')
  424. X        {
  425. X        *tp++ = *sp;
  426. X        cwidth++;
  427. X        }
  428. X        else switch (*++sp)
  429. X        {
  430. X        case '%':
  431. X        *tp++ = '%';
  432. X        cwidth++;
  433. X        break;
  434. X        case 'h':
  435. X        *tp++ = ((width * mode->width) / 256);
  436. X        cwidth++;
  437. X        break;
  438. X        case 'l':
  439. X        *tp++ = (width * mode->width) % 256;
  440. X        cwidth++;
  441. X        break;
  442. X        case 'c':
  443. X        /* compute the row lengths */
  444. X        for (i = 0; i < mode->height; i++)
  445. X            lrow[i] = strlen(graphic[i]);
  446. X
  447. X        /* now compute and emit Epson-flavored graphics bits */
  448. X        for (i = 0; i < width * mode->width; i++)
  449. X        {
  450. X            *tp++
  451. X            = (lrow[7] > i && graphic[7][i] == STAR) * 1
  452. X            + (lrow[6] > i && graphic[6][i] == STAR) * 2
  453. X            + (lrow[5] > i && graphic[5][i] == STAR) * 4
  454. X            + (lrow[4] > i && graphic[4][i] == STAR) * 8
  455. X            + (lrow[3] > i && graphic[3][i] == STAR) * 16
  456. X            + (lrow[2] > i && graphic[2][i] == STAR) * 32
  457. X            + (lrow[1] > i && graphic[1][i] == STAR) * 64
  458. X            + (lrow[0] > i && graphic[0][i] == STAR) * 128;
  459. X        }
  460. X        cwidth += width * mode->width;
  461. X        break;
  462. X        default:
  463. X        (void) fprintf(stderr,
  464. X               "dotmatrix: invalid escape in mode declaration\n");
  465. X        exit(1);
  466. X        break;
  467. X        }
  468. X    }
  469. X    enter(name, width, -1, cwidth, value);
  470. X    }
  471. X
  472. X    /* now we may need to generate a test file line */
  473. X    if (testflag)
  474. X    (void) fprintf(testfp, "\\%s  |%s|  %s\n.br\n", name, name, comment);
  475. X}
  476. X
  477. Xstatic void enter(name, width, tstate, len, bytes)
  478. X/* generate a postprocessor table entry */
  479. Xchar    *name;    /* name of the entry */
  480. Xint    width;  /* its nroff width */
  481. Xint    tstate;    /* the toggle state entry */
  482. Xint    len;    /* number of data bytes in entry */
  483. Xchar    *bytes;    /* data bytes to emit */
  484. X{
  485. X    register int    i;
  486. X    int            funnycount = 0;
  487. X    char        bbuf[MAXGLEN * 5 + 1];
  488. X
  489. X    if (tstate != -1)    /* force toggles to be done in the postprocessor */
  490. X    funnycount = 1;
  491. X    else
  492. X    /* test to see if the data contains nulls or plot-mode triggers */
  493. X    for (i = 0; i < len; i++)
  494. X        if (bytes[i] == 0 || (bytes[i] & 0200))
  495. X        funnycount++;
  496. X
  497. X    /* if there are none, embed the sequence in the driver table */
  498. X    if (funnycount == 0 && !forcepost)
  499. X    {
  500. X    if (dtabflag)
  501. X    {
  502. X        char *np = name;
  503. X
  504. X        if (np[0] == '\\' && np[1] == '(')
  505. X        np += 2;
  506. X
  507. X        (void) expand(bytes, bbuf);
  508. X        (void) fprintf(dtabfp, "%s %d %s\n", np, width, bbuf);
  509. X        if (!quiet || verbose)
  510. X        (void) fprintf(stdout,
  511. X               "%s will be handled by the driver table\n", name);
  512. X    }
  513. X    return;
  514. X    }
  515. X
  516. X    /* if we're generating a postprocessor, write the entry */
  517. X    if (postflag)
  518. X    {
  519. X    char    *ttype = "";
  520. X
  521. X    if (tstate == 0)
  522. X        ttype = " on ";
  523. X    else if (tstate == 1)
  524. X        ttype = " off";
  525. X
  526. X    (void) fprintf(postfp,
  527. X               "/* %s%s */ {%d, %d, ", name, ttype, tstate, len);
  528. X
  529. X    for (i = 0; i < len; i++)
  530. X        (void) fprintf(postfp, "0x%02x,", bytes[i] & 0xff);
  531. X
  532. X    (void) fprintf(postfp, "},\n");
  533. X    }
  534. X
  535. X    /* update the special character count and generate a driver change */
  536. X    if (tstate == 1)    /* a toggle end string doesn't get its own entry, */
  537. X    trigger++;    /*  but must skip a postprocessor table slot      */
  538. X    else        /* a graphic or the start string of a toggle */
  539. X    {
  540. X    if (!forcepost && (!quiet || verbose))
  541. X        (void) fprintf(stdout,
  542. X        "%s will require postprocessor assistance\n",
  543. X        name);
  544. X
  545. X    if (dtabflag)
  546. X    {
  547. X        char *np = name;
  548. X
  549. X        if (np[0] == '\\' && np[1] == '(')
  550. X        np += 2;
  551. X
  552. X        if (isprint(trigger) && trigger != '\\' && trigger != ' ')
  553. X        (void) fprintf(dtabfp, "%s %d \\%03.3o%c\\%03.3o\n",
  554. X              np, width, SI, trigger++, SO);
  555. X        else
  556. X        (void) fprintf(dtabfp, "%s %d \\%03.3o\\%03.3o\\%03.3o\n",
  557. X              np, width, SI, trigger++, SO);
  558. X    }
  559. X    }
  560. X}
  561. X
  562. X/* dotmatrix.c ends here */
  563. END_OF_FILE
  564. if test 14559 -ne `wc -c <'dotmatrix.c'`; then
  565.     echo shar: \"'dotmatrix.c'\" unpacked with wrong size!
  566. fi
  567. # end of 'dotmatrix.c'
  568. fi
  569. if test -f 'mx80.pix' -a "${1}" != "-c" ; then 
  570.   echo shar: Will not clobber existing file \"'mx80.pix'\"
  571. else
  572. echo shar: Extracting \"'mx80.pix'\" \(7360 characters\)
  573. sed "s/^X//" >'mx80.pix' <<'END_OF_FILE'
  574. X# nroff driver table and postprocessor-generation data for Epson MX80
  575. Xmx80
  576. X# nroff/troff motion parameters
  577. Xbset        0    # bits to set in c_oflag
  578. Xbreset      0    # bits to reset in c_oflag
  579. XHor         24    # horizontal grain (1/10th in.)
  580. XVert        20    # vertical grain (1/12th in.)
  581. XNewline     40    # 6 lines-per-inch
  582. XChar        24    # 10 chars-per-inch
  583. XEm          24    # an em is one character width
  584. XHalfline    20    # a half-line width is a twelfth of an inch
  585. XAdj         24    # the adjustment unit is an em
  586. X#
  587. X# MX80 highlight strings
  588. Xtwinit      "\033@"    # printer initialization
  589. Xtwrest      "\033@"    # printer reset
  590. Xtwnl        "\n"    # newline & clear-highlight string
  591. Xhlr         "\0338"    # move half-line up (col convention)
  592. Xhlf         "\0339"    # move half-line down (col convention)
  593. Xflr         "\0337"    # move full line up (col convention)
  594. Xbdon        "\033E"    # turn bold on
  595. Xbdoff       "\033F"    # turn bold off
  596. Xiton        "\033>"    # turn italic on
  597. Xitoff       "\033="    # turn italic off
  598. Xploton      ""        # plot mode on (not supported)
  599. Xplotoff     ""        # plot mode off (not supported)
  600. Xup          ""        # plot mode move up (not supported)
  601. Xdown        ""        # plot mode move down (not supported)
  602. Xright       ""        # plot mode move right (not supported)
  603. Xleft        ""        # plot mode move left (not supported)
  604. X
  605. Xcharset
  606. Xcomment This font implements most of the standard nroff graphics for the Epson
  607. Xcomment MX80 and compatibles. Some of what would be greek-alphabet  characters
  608. Xcomment have been stolen  for use as Epson highlight toggles;  if you have new
  609. Xcomment nroff, you can rename these to whatever you like and restore the orig-
  610. Xcomment inal loadings. Composed by Eric S. Raymond, Feb 1988.                 
  611. X# define Epson-compatible modes
  612. Xmode single  6 8 "\eK%l%h%c"    # 60 dpi
  613. Xmode double 12 8 "\eL%l%h%c"    # 120 dpi
  614. Xmode triple 12 8 "\eY%l%h%c"    # 120dpi at double speed (Not presently used)
  615. Xmode quad   24 8 "\eZ%l%h%c"    # 240dpi (Not presently used)
  616. X# The following modes are good on the Star Micronics NX10 only
  617. Xmode crt1    8 8 "\e*\004%l%h%c"    # 80 dpi (Not presently used)
  618. Xmode plotter 8 8 "\e*\005%l%h%c"    # 72 dpi (Not presently used)
  619. Xmode crt2    9 8 "\e*\006%l%h%c"    # 90 dpi (Not presently used)
  620. X# define start/end sequences for extra Epson highlights
  621. Xtoggle \(*w "\eW\001"    "\eW\000"    # toggle double width
  622. Xtoggle \(*g "\eG"    "\eH"        # toggle double strike
  623. Xtoggle \(*s "\eS\000"    "\eT"         # toggle superscript
  624. Xtoggle \(*r "\eS\001"    "\eT"        # toggle subscript
  625. X#
  626. X# define the slashout toggle
  627. Xoverstrike \(*x /
  628. Xoverstrike \(*u _
  629. X#
  630. X# tests for the two normal highlights
  631. Xtest This is a \fBboldface\fR test
  632. Xtest This is an \fIitalics\fR test
  633. X
  634. Xpicture \(sq 1 single 6    # square
  635. X
  636. X******
  637. X*    *
  638. X*    *
  639. X*    *
  640. X*    *
  641. X******
  642. X
  643. Xpicture \(bu 1 single 6    # bullet
  644. X
  645. X  **
  646. X ****
  647. X******
  648. X******
  649. X******
  650. X ****
  651. X  **
  652. Xpicture \(de 1 single 6    # degree
  653. X   *
  654. X  * *
  655. X   *
  656. X
  657. X
  658. X
  659. X
  660. X
  661. Xpicture \(dg 1 single 6    # dagger
  662. X
  663. X   *
  664. X   *
  665. X *****
  666. X   *
  667. X   *
  668. X   *
  669. X   *
  670. Xpicture \(sc 1 single 6    # section-mark
  671. X  **
  672. X *  *
  673. X **
  674. X * *
  675. X  * *
  676. X   **
  677. X *  *
  678. X  **
  679. Xpicture \(aa 1 single 6    # acute-accent
  680. X    *
  681. X   *
  682. X
  683. X
  684. X
  685. X
  686. X
  687. X
  688. Xpicture \(ga 1 single 6    # grave-accent
  689. X  *
  690. X   *
  691. X
  692. X
  693. X
  694. X
  695. X
  696. X
  697. Xpicture \(*a 1 single 6    # alpha
  698. X
  699. X
  700. X
  701. X *** *
  702. X*   *
  703. X*   *
  704. X*   *
  705. X *** *
  706. Xpicture \(*b 1 single 6    # beta
  707. X ****
  708. X*    *
  709. X*    *
  710. X*****
  711. X*    *
  712. X*    *
  713. X*****
  714. X*
  715. Xpicture \(*d 1 single 6    # delta
  716. X ****
  717. X*    *
  718. X*    *
  719. X*
  720. X ****
  721. X*    *
  722. X*    *
  723. X ****
  724. Xpicture \(*e 1 single 6    # epsilon
  725. X
  726. X  ****
  727. X *
  728. X*
  729. X******
  730. X*
  731. X *
  732. X  ****
  733. Xpicture \(*p 1 single 6    # pi
  734. X
  735. X
  736. X
  737. X******
  738. X *  *
  739. X *  *
  740. X *  *
  741. X *  *
  742. Xpicture \(*G 1 single 6    # cap-gamma
  743. X
  744. X *****
  745. X *   *
  746. X *
  747. X *
  748. X *
  749. X *
  750. X***
  751. Xpicture \(*H 1 single 6    # cap-theta
  752. X  **
  753. X *  *
  754. X*    *
  755. X*    *
  756. X******
  757. X*    *
  758. X *  *
  759. X  **
  760. Xpicture \(*C 1 single 6    # cap-xi
  761. X
  762. X******
  763. X
  764. X
  765. X ****
  766. X
  767. X
  768. X******
  769. Xpicture \(*P 1 single 6    # cap-pi
  770. X******
  771. X *  *
  772. X *  *
  773. X *  *
  774. X *  *
  775. X *  *
  776. X *  *
  777. X**  **
  778. Xpicture \(*S 1 single 6    # cap-sigma
  779. X******
  780. X*    *
  781. X *   
  782. X  *
  783. X  *
  784. X *
  785. X*    *
  786. X******
  787. Xpicture \(*F 1 single 6    # cap-phi
  788. X ****
  789. X  **
  790. X ****
  791. X* ** *
  792. X* ** *
  793. X ****
  794. X  **
  795. X ****
  796. Xpicture \(*W 1 single 6    # cap-omega
  797. X ****
  798. X*    *
  799. X*    *
  800. X*    *
  801. X*    *
  802. X*    *
  803. X *  *
  804. X**  **
  805. Xpicture \(ts 1 single 6    # terminal-sigma
  806. X
  807. X
  808. X ***
  809. X*   *
  810. X*
  811. X ***
  812. X    *
  813. X   *
  814. Xpicture \(>= 1 single 6    # greater-than
  815. X *
  816. X  *
  817. X   *
  818. X    *
  819. X   *
  820. X  *
  821. X *
  822. X ****
  823. Xpicture \(<= 1 single 6    # less-than
  824. X    *
  825. X   *
  826. X  *
  827. X *
  828. X  *
  829. X   *
  830. X    *
  831. X ****
  832. Xpicture \(== 1 single 6    # identity
  833. X
  834. X
  835. X******
  836. X
  837. X******
  838. X
  839. X******
  840. X
  841. Xpicture \(~= 1 single 6    # approximately-equals
  842. X
  843. X **  *
  844. X*  **
  845. X
  846. X******
  847. X
  848. X******
  849. X
  850. Xpicture \(-> 1 single 6    # right-arrow
  851. X
  852. X   *
  853. X    *
  854. X******
  855. X    *
  856. X   *
  857. X
  858. X
  859. Xpicture \(<- 1 single 6    # left-arrow
  860. X
  861. X  *
  862. X *
  863. X******
  864. X *
  865. X  *
  866. X
  867. X
  868. Xpicture \(ua 1 single 6    # up-arrow
  869. X   *
  870. X  ***
  871. X * * *
  872. X   *
  873. X   *
  874. X   *
  875. X   *
  876. X   *
  877. Xpicture \(da 1 single 6    # down-arrow
  878. X   *
  879. X   *
  880. X   *
  881. X   *
  882. X   *
  883. X * * *
  884. X  ***
  885. X   *
  886. Xpicture \(mu 1 single 6    # multiply-sign
  887. X
  888. X*    *
  889. X *  *
  890. X  **
  891. X  **
  892. X *  *
  893. X*    *
  894. X
  895. Xpicture \(di 1 single 6    # divide-sign
  896. X
  897. X
  898. X  *
  899. X*****
  900. X  *
  901. X
  902. X
  903. X
  904. Xpicture \(+- 1 single 6    # plus-or-minus
  905. X
  906. X  *
  907. X  *
  908. X*****
  909. X  *
  910. X  *
  911. X*****
  912. X
  913. Xpicture \(cu 1 single 6    # union (cup)
  914. X
  915. X*    *
  916. X*    *
  917. X*    *
  918. X*    *
  919. X*    *
  920. X ****
  921. X
  922. Xpicture \(ca 1 single 6    # intersection (cap)
  923. X
  924. X ****
  925. X*    *
  926. X*    *
  927. X*    *
  928. X*    *
  929. X*    *
  930. X
  931. Xpicture \(sb 1 single 6    # subset
  932. X
  933. X
  934. X *****
  935. X*
  936. X*
  937. X*
  938. X *****
  939. X
  940. Xpicture \(sp 1 single 6    # superset
  941. X
  942. X
  943. X*****
  944. X     *
  945. X     *
  946. X     *
  947. X*****
  948. X
  949. Xpicture \(ib 1 single 6    # improper-subset
  950. X
  951. X *****
  952. X*
  953. X*
  954. X*
  955. X *****
  956. X
  957. X******
  958. Xpicture \(ip 1 single 6    # improper-superset
  959. X
  960. X*****
  961. X     *
  962. X     *
  963. X     *
  964. X*****
  965. X
  966. X******
  967. Xpicture \(if 1 single 6    # infinity
  968. X
  969. X
  970. X ** *
  971. X*  * *
  972. X*  * *
  973. X ** *
  974. X
  975. X
  976. Xpicture \(pd 1 single 6    # partial-derivative
  977. X
  978. X  ***
  979. X *   *
  980. X     *
  981. X  ****
  982. X *   *
  983. X *   *
  984. X  ***
  985. Xpicture \(no 1 single 6    # not-sign
  986. X
  987. X
  988. X
  989. X *****
  990. X     *
  991. X
  992. X
  993. X
  994. Xpicture \(is 1 single 6    # integral
  995. X   *
  996. X  * *
  997. X  *
  998. X  *
  999. X  *
  1000. X  *
  1001. X* *
  1002. X *
  1003. Xpicture \(pt 1 single 6    # proportional-to
  1004. X
  1005. X
  1006. X ** **
  1007. X*  *
  1008. X*  *
  1009. X ** **
  1010. X
  1011. X
  1012. Xpicture \(es 1 single 6    # empty-set
  1013. X
  1014. X  ** *
  1015. X *  *
  1016. X*  * *
  1017. X* *  *
  1018. X *  *
  1019. X* **
  1020. X
  1021. Xpicture \(mo 1 single 6    # member-of
  1022. X
  1023. X
  1024. X *****
  1025. X*
  1026. X******
  1027. X*
  1028. X *****
  1029. X
  1030. Xpicture \(rg 1 single 6    # registration-mark
  1031. X ****
  1032. X*    *
  1033. X***  *
  1034. X** * *
  1035. X***  *
  1036. X** * *
  1037. X*    *
  1038. X ****
  1039. Xpicture \(co 1 single 6    # copyright
  1040. X ****
  1041. X*    *
  1042. X* ** *
  1043. X**   *
  1044. X**   *
  1045. X* ** *
  1046. X*    *
  1047. X ****
  1048. Xpicture \(br 1 single 6    # box-rule
  1049. X   *
  1050. X   *
  1051. X   *
  1052. X   *
  1053. X   *
  1054. X   *
  1055. X   *
  1056. X   *
  1057. Xpicture \(ct 1 single 6    # cent-sign
  1058. X    
  1059. X   *
  1060. X *****
  1061. X*  *
  1062. X*  *
  1063. X*  *
  1064. X *****
  1065. X   *
  1066. Xpicture \(dd 1 single 6    # double-dagger
  1067. X
  1068. X   *
  1069. X *****
  1070. X   *
  1071. X   *
  1072. X   *
  1073. X *****
  1074. X   *
  1075. Xpicture \(lh 1 single 6    # left-hand
  1076. X
  1077. X
  1078. X**** *
  1079. X *****
  1080. X  ****
  1081. X  ** *
  1082. X
  1083. X
  1084. Xpicture \(rh 1 single 6    # right-hand
  1085. X
  1086. X
  1087. X* ****
  1088. X*****
  1089. X****
  1090. X* **
  1091. X
  1092. X
  1093. Xpicture \(ci 1 single 6    # circle
  1094. X
  1095. X  **
  1096. X *  *
  1097. X*    *
  1098. X*    *
  1099. X*    *
  1100. X *  *
  1101. X  **
  1102. Xpicture \(lt 1 single 6    # curly-left-top
  1103. X   **
  1104. X  ***
  1105. X  **
  1106. X  **
  1107. X  **
  1108. X  **
  1109. X  **
  1110. X  **
  1111. Xpicture \(lb 1 single 6    # curly-left-bottom
  1112. X  **
  1113. X  **
  1114. X  **
  1115. X  **
  1116. X  **
  1117. X  **
  1118. X  ***
  1119. X   **
  1120. Xpicture \(rt 1 single 6    # curly-right-top
  1121. X **
  1122. X ***
  1123. X  **
  1124. X  **
  1125. X  **
  1126. X  **
  1127. X  **
  1128. X  **
  1129. Xpicture \(rb 1 single 6    # curly-right-bottom
  1130. X  **
  1131. X  **
  1132. X  **
  1133. X  **
  1134. X  **
  1135. X  **
  1136. X ***
  1137. X **
  1138. Xpicture \(lk 1 single 6    # curly-left-center
  1139. X  **
  1140. X  **
  1141. X  **
  1142. X **
  1143. X **
  1144. X  **
  1145. X  **
  1146. X  **
  1147. Xpicture \(rk 1 single 6    # curly-right-center
  1148. X  **
  1149. X  **
  1150. X  **
  1151. X   **
  1152. X   **
  1153. X  **
  1154. X  **
  1155. X  **
  1156. Xpicture \(bv 1 single 6    # bold-vertical-rule
  1157. X  **
  1158. X  **
  1159. X  **
  1160. X  **
  1161. X  **
  1162. X  **
  1163. X  **
  1164. X  **
  1165. Xpicture \(lf 1 single 6    # left-bottom-bracket
  1166. X  **
  1167. X  **
  1168. X  **
  1169. X  **
  1170. X  **
  1171. X  **
  1172. X  **
  1173. X  ****
  1174. Xpicture \(rf 1 single 6    # right-bottom-bracket
  1175. X  **
  1176. X  **
  1177. X  **
  1178. X  **
  1179. X  **
  1180. X  **
  1181. X  **
  1182. X****
  1183. Xpicture \(lc 1 single 6    # left-top-bracket
  1184. X  ****
  1185. X  **
  1186. X  **
  1187. X  **
  1188. X  **
  1189. X  **
  1190. X  **
  1191. X  **
  1192. Xpicture \(rc 1 single 6    # right-top-bracket
  1193. X****
  1194. X  **
  1195. X  **
  1196. X  **
  1197. X  **
  1198. X  **
  1199. X  **
  1200. X  **
  1201. X
  1202. END_OF_FILE
  1203. if test 7360 -ne `wc -c <'mx80.pix'`; then
  1204.     echo shar: \"'mx80.pix'\" unpacked with wrong size!
  1205. fi
  1206. # end of 'mx80.pix'
  1207. fi
  1208. echo shar: End of archive 2 \(of 2\).
  1209. cp /dev/null ark2isdone
  1210. MISSING=""
  1211. for I in 1 2 ; do
  1212.     if test ! -f ark${I}isdone ; then
  1213.     MISSING="${MISSING} ${I}"
  1214.     fi
  1215. done
  1216. if test "${MISSING}" = "" ; then
  1217.     echo You have unpacked both archives.
  1218.     rm -f ark[1-9]isdone
  1219. else
  1220.     echo You still need to unpack the following archives:
  1221.     echo "        " ${MISSING}
  1222. fi
  1223. ##  End of shell archive.
  1224. exit 0
  1225.